package com.demo2do.fms.admin.service.supplier;

import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.demo2do.core.entity.page.Page;
import com.demo2do.fms.admin.entity.report.supplier.TractorReportSearch;
import com.demo2do.fms.admin.entity.search.supplier.TractorSearch;
import com.demo2do.fms.admin.entity.security.Login;
import com.demo2do.fms.admin.entity.upload.UploadResult;
import com.demo2do.fms.admin.service.DataService;
import com.demo2do.fms.entity.supplier.common.Supplier;
import com.demo2do.fms.entity.vehicle.AuditStatus;
import com.demo2do.fms.entity.vehicle.DeclareStatus;
import com.demo2do.fms.entity.vehicle.tractor.Tractor;
import com.demo2do.fms.entity.vehicle.tractor.TractorModifiedVersion;

/**
 *
 * @author Ark
 *
 */
public interface TractorService extends DataService<Tractor> {

    /**
     * @param status
     * @return
     */
    public int count(Login login, AuditStatus status);
    
    /**
     * @param status
     * @param page
     * @return
     */
    public List<Tractor> list(Login login, AuditStatus status, Page page);
    
    /**
     * @param search
     * @return
     */
    public int count(TractorSearch search);
    
    /**
     * @param search
     * @param page
     * @return
     */
    public List<Tractor> search(TractorSearch search, Page page);
    
    /**
     * @param tractor
     * @param login
     */
    public void create(Tractor tractor, Login login);
    
    /**
     * @param file
     * @param login
     * @return
     */
    public List<UploadResult> upload(MultipartFile file, Login login);
    
    /**
     * @param category
     * @param brandCNCode
     * @param simcard
     * @return
     */
    public Map<String, Object> exist(String category, String brandCNCode, String simcard);

    /**
     * @param tractor
     * @param operator
     */
    public void audit(Tractor tractor, Long operator);
    
    /**
     * @param ids
     * @param operator
     * @return
     */
    public int batchAudit(List<Long> ids, Long operator);
    
    /**
     * @param tractor
     * @param operator
     */
    public void editInfo(Tractor tractor, Long operator);
    
    /**
     * @param tractor
     * @param operator
     */
    public void editGps(Tractor tractor, Long operator);
    
    /**
     * @param tractor
     * @param operator
     */
    public void delete(Tractor tractor, Long operator);
    
    /**
     * @param tractor
     * @return
     */
    public TractorModifiedVersion prepareChange(Tractor tractor);
    
    /**
     * @param tractor
     * @param version
     * @param operator
     */
    public void change(Tractor tractor, TractorModifiedVersion version, Long operator);
    
    /**
     * @param tractor
     * @return
     */
    public TractorModifiedVersion loadModifiedVersion(Tractor tractor);
    
    /**
     * @param tractor
     * @param supplier
     * @param operator
     */
    public void transfer(Tractor tractor, Supplier supplier, Long operator);
    
    /**
     * @param tractor
     * @param operator
     */
    public void out(Tractor tractor, Long operator);
    
    /**
     * @param login
     * @return
     */
    public int count(Login login);
    
    /**
     * @param login
     * @param page
     * @return
     */
    public List<Tractor> list(Login login, Page page);
    
    /**
     * @param search
     * @return
     */
    public List<Map<String, Object>> export(TractorReportSearch search);
    
    /**
     * @param login
     * @return
     */
    public int countSub(Login login);
    
    /**
     * @param login
     * @param page
     * @return
     */
    public List<Tractor> listSub(Login login, Page page);
    
    /**
     * @param search
     * @param login
     * @return
     */
    public int countSub(TractorSearch search, Login login);
    
    /**
     * @param search
     * @param login
     * @param page
     * @return
     */
    public List<Tractor> searchSub(TractorSearch search, Login login, Page page);
    
    /**
     * @param login
     * @return
     */
    public int countAudit(Login login, DeclareStatus declareStatus);
    
    /**
     * @param login
     * @param page
     * @return
     */
    public List<Tractor> listAudit(Login login, DeclareStatus declareStatus, Page page);
    
    /**
     * @param tractor
     * @param operator
     */
    public void adoptAuditing(Tractor tractor, Long operator);
    
    /**
     * @param tractor
     * @param operator
     */
    public void adoptModified(Tractor tractor, Long operator);
    
    /**
     * @param tractor
     * @param operator
     */
    public void rejectAudit(Tractor tractor, Long operator);
    
    /**
     * @param vehicleSource
     * @param operator
     */
    public void rejectModified(Tractor tractor, Long operator);
    
    /**
     * @param supplier
     * @param status
     * @return
     */
    public List<Tractor> listUnbind(Supplier supplier, AuditStatus status);
    
}
